package day1.HomeWork;

/**
 * ClassName：ReturnExceptionDemo
 *
 * @Author：小鱼
 * @Create：2025-08-18 18:36
 */
public class ReturnExceptionDemo {
    public static void methodA() throws Exception {
        try {
            System.out.println("进⼊⽅法A");
            throw new Exception("制造异常");
        } finally {
            System.out.println("A⽅法的finally");
        }
    }
    public static int methodB() {
        try {
            System.out.println("进⼊⽅法B");
            return 1;
        } finally {
            System.out.println("B⽅法的finally");
            return 2;
        }
    }
    public static void main(String[] args) {
        try {
            methodA();
        } catch (Exception e) {
            System.out.println(e.getMessage());
        }
        int i = methodB();
        System.out.println(i);
    }
}
